<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="language" content="en" />
        <title><?php echo CHtml::encode($this->pageTitle); ?></title>
        <link rel="stylesheet" type="text/css" href="<?php echo urlCss(); ?>bootstrap.min.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo urlCss(); ?>font/css/font-awesome.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo urlCss(); ?>sb-admin.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo urlCss(); ?>pager.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo urlJs(); ?>plugins/datepicker/datepicker.css" />
        <!--<script type="text/javascript" src="<?php echo urlJs(); ?>jquery-1.10.2.js" ></script>-->
        <script type="text/javascript" src="<?php echo urlJs(); ?>bootstrap.min.js"></script>
	<script type="text/javascript" src="<?php echo urlJs(); ?>plugins/metisMenu/jquery.metisMenu.js"></script>
	<script type="text/javascript" src="<?php echo urlJs(); ?>sb-admin.js"></script>
        <script type="text/javascript" src="<?php echo urlJs(); ?>jquery.form.js"></script>
        <script type="text/javascript" src="<?php echo urlJs(); ?>bootstrap_typeahead.js"></script>
        <script type="text/javascript" src="<?php echo urlJs(); ?>plugins/datepicker/bootstrap-datepicker.js"></script>
    </head>
    <body>
        <div id="wrapper">

            <nav class="navbar navbar-default navbar-fixed-top" role="navigation" style="margin-bottom: 0">
                <div class="navbar-header">
                    
                    <a class="navbar-brand" href="#">
                        <img src="<?php echo UrlImage()?>logo.png" style="height: 31px;position: relative;top: -6px;left: 3px;" />
                    </a>
                </div>
                <!-- /.navbar-header -->

                <ul class="nav navbar-top-links navbar-right">
                    
                    
                    
                    <!-- /.dropdown -->
                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <i class="fa fa-user fa-fw"></i>  <i class="fa fa-caret-down"></i>
                        </a>
                        <?php if(!Yii::app()->user->isGuest):?>
         
                        <ul class="dropdown-menu dropdown-user">
                            <li>
                                <a href="<?php echo Yii::app()->createUrl("admin/logout")?>"><i class="fa fa-gear fa-fw"></i> Đăng xuất</a>
                            </li>
                            
                            </li>
                        </ul>
                        <?php endif;?>
                        <!-- /.dropdown-user -->
                    </li>
                    <!-- /.dropdown -->
                </ul>
                <!-- /.navbar-top-links -->

                <div class="navbar-default navbar-static-side" role="navigation">
                    <div class="sidebar-collapse">
                        <ul class="nav" id="side-menu">
                            
                            <li id="danh_muc">
                               
                                <a href="#"><i class="glyphicon glyphicon-th-list"></i> Quản lý sản phẩm<span class="fa arrow"></span></a>
                                <ul class="nav nav-second-level">
                                    <li>
                                        <a href = "<?php echo Yii::app()->createUrl("category/index/") ?>" >Danh mục sản phẩm</a>
                                    </li>
                                    <li>
                                        <a href = "<?php echo Yii::app()->createUrl("Product/index/") ?>" >Danh sách sản phẩm</a>
                                    </li>
                                    <li>
                                        <a href = "<?php echo Yii::app()->createUrl("ProductType/index/") ?>" >Loại sản phẩm</a>
                                    </li>
                                    <li>
                                        <a href = "<?php echo Yii::app()->createUrl("Property/index/") ?>" >Thuộc tính sản phẩm</a>
                                    </li>
                                </ul>
                                <!-- /.nav-second-level -->
                            </li>
                            
                            <li id="ban_hang">
                               
                                <a href="#"><i class="glyphicon glyphicon-th-list"></i> Quản lý bán hàng<span class="fa arrow"></span></a>
                                <ul class="nav nav-second-level">
                                    <li>
                                        <a href = "<?php echo Yii::app()->createUrl("user/index/") ?>" >Danh sách khách hàng</a>
                                    </li>
                                    <li>
                                        <a href = "<?php echo Yii::app()->createUrl("order/index/") ?>" >Danh sách đơn hàng</a>
                                    </li>
                                </ul>
                                <!-- /.nav-second-level -->
                            </li>
                            
                            <li id="cms">
                                <a href="#"><i class="glyphicon glyphicon-th-list"></i> CMS<span class="fa arrow"></span></a>
                                <ul class="nav nav-second-level">
                                    <li>
                                        <a href = "<?php echo Yii::app()->createUrl("taxonomy/index/") ?>" >Danh mục tin tức</a>
                                    </li>
                                    <li>
                                        <a href = "<?php echo Yii::app()->createUrl("News/index/") ?>" >Danh sách bản tin</a>
                                    </li>
                                    <li>
                                        <a href = "<?php echo Yii::app()->createUrl("email/index/") ?>" >Danh sách Email</a>
                                    </li>
                                    <li>
                                        <a href = "<?php echo Yii::app()->createUrl("Newsletter/index/") ?>" >Bản tin điện tử</a>
                                    </li>
                                </ul>
                                <!-- /.nav-second-level -->
                            </li>
                            <li id="banner">
                               
                                <a href="#"><i class="glyphicon glyphicon-th-list"></i> Quản lý Banner<span class="fa arrow"></span></a>
                                <ul class="nav nav-second-level">
                                    <li>
                                        <a href = "<?php echo Yii::app()->createUrl("banner/home/") ?>" >Banner trang chủ</a>
                                    </li>
                                    <li>
                                        <a href = "<?php echo Yii::app()->createUrl("banner/news/") ?>" >Banner trang tin tức</a>
                                    </li>
                                </ul>
                                <!-- /.nav-second-level -->
                            </li>
                            <li id="admin">
                               
                                <a href="#"><i class="glyphicon glyphicon-th-list"></i> Quản lý tài khoản Admin<span class="fa arrow"></span></a>
                                <ul class="nav nav-second-level">
                                    <li>
                                        <a href = "<?php echo Yii::app()->createUrl("account/list/") ?>" >Danh sách tài khoản</a>
                                    </li>
                                </ul>
                                <!-- /.nav-second-level -->
                            </li>
                            <li id="menu">
                               
                                <a href="<?php echo Yii::app()->createUrl("menu/index/") ?>"><i class="glyphicon glyphicon-th-list"></i> Quản lý Menu<span class="fa arrow"></span></a>
                                
                                <!-- /.nav-second-level -->
                            </li>
                            
                        </ul>
                        <!-- /#side-menu -->
                    </div>
                    <!-- /.sidebar-collapse -->
                </div>
                <!-- /.navbar-static-side -->
            </nav>
            <div id="main_content_admin">
                <div id="page-wrapper">
                    <div class="row">
                        <?php
                        $this->widget('booster.widgets.TbAlert', array(
                            'fade' => true,
                            'closeText' => '&times;', // false equals no close link
                            'events' => array(),
                            'htmlOptions' => array(),
                            'userComponentId' => 'user',
                            'alerts' => array( // configurations per alert type
                                // success, info, warning, error or danger
                                'success' => array('closeText' => '&times;'),
                                'info', // you don't need to specify full config
                                'warning' => array('closeText' => false),
                                'error' => array('closeText' => 'AAARGHH!!')
                            ),
                        ));
                        ?>
                        <?php echo $content; ?>
                    </div>
                </div>
            </div>
        </div>
        <!-- /#wrapper -->
        <script>
                $(document).ready(function(){
                    var main_menu = $('<?php echo $this->menu_backend?>');
                    main_menu.addClass('active');
                    main_menu.find('.nav-second-level').removeClass('collapse').addClass('collapse in');
                    main_menu.find('.nav-second-level').css({'height':'auto'});
                });
        </script>
    </body>
</html>
